#include "graph.h"
#include <iostream>
using namespace std;
using Vertex = std::string;
int main(int argc, char const *argv[])
{
    Vertex a = "sanben";
    Vertex b = "top3";
    Vertex c = "zju";

    cout << "-------------------------Test 1---------------------\n";
    const GraphStorageMode M0 = AutoMode(3, 6);
    cout << "AutoChooseMode: " << M0 <<" // 0 for AdjList and 1 for AdjMatrix."<< endl;
    if (M0 == GraphStorageMode::AdjList)
    {
        Graph<GraphStorageMode::AdjList> gp1({a, b, c},
                                             {{&a, &b, 1e-5},
                                              {&b, &a, 1e-5},
                                              {&b, &c, 9},
                                              {&c, &b, 10},
                                              {&a, &c, 1e-5},
                                              {&c, &a, 1e5}});
        gp1.listVertexes();
        gp1.listEdges();
    }
    else
    {
        Graph<GraphStorageMode::AdjMatrix> gp1({a, b, c},
                                               {{&a, &b, 1e-5},
                                                {&b, &a, 1e-5},
                                                {&b, &c, 9},
                                                {&c, &b, 10},
                                                {&a, &c, 1e-5},
                                                {&c, &a, 1e5}});
        gp1.listVertexes();
        gp1.listEdges();
    }
    cout << "-------------------------Test 2---------------------\n";
    const GraphStorageMode M1 = AutoMode(3, 2);
    cout << "AutoChooseMode: " << M1 <<" // 0 for AdjList and 1 for AdjMatrix."<< endl;
    if (M1 == GraphStorageMode::AdjList)
    {
        Graph<GraphStorageMode::AdjList> gp1({a, b, c},
                                             {{&b, &c, 9},
                                              {&c, &a, 1e5}});
        gp1.listVertexes();
        gp1.listEdges();
    }
    else
    {
        Graph<GraphStorageMode::AdjList> gp1({a, b, c},
                                             {{&b, &c, 9},
                                              {&c, &a, 1e5}});
        gp1.listVertexes();
        gp1.listEdges();
    }

}
